home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / games2 / twast11.zip / TWASTMAC.ZIP / TWASSIST.ASP next >
Text File  |  1993-02-06  |  9KB  |  219 lines

  1. ;  This script is for use with the Trade Wars Assistant by Albin Gersich,
  2. ;but the information it obtains can be used with a number of Trade Wars
  3. ;utilities.  It was compiled and tested with Procomm Plus for Dos, version
  4. ;2.01.  I'm not sure of it's compatibility with Procomm Plus for Windows.
  5. ;  This script is released to the public domain.  The author of this script
  6. ;will in no way be held liable for any damage or harm of any kind.  This
  7. ;script has been tested extensively by myself, and so is as bug free as
  8. ;possible, but nothing is absolutely 100% safe.  Let the buyer beware!
  9. ;  The script captures your CIM port and sector reports, fighter, mines,
  10. ;avoids, and the game status in a variety of ways.  You can also use it to
  11. ;access TW Assistant easily while online.
  12. ;  The macro was designed so that you don't have to capture a complete data
  13. ;file all the time.  Often times, you only want to capture the latest port
  14. ;information, or update your fighter info in the database for transwarp
  15. ;calculations while online.  I wanted to do these things quickly and
  16. ;efficiently, so I took the heart of Casey Stemp's macro and greatly
  17. ;expanded on it.
  18. ;  Everything is accessed through the main menu.  When you run the macro,
  19. ;the menu will be displayed with the items and their hot-keys.  To access
  20. ;an item, just press the appropriate hotkey.  Each menu item is explained
  21. ;below:
  22. ;
  23. ;  "<A>ssistant" - This takes you directly to Trade Wars Assistant.  It
  24. ;skips the checking for old capture files so they remain intact.  Note,
  25. ;too, that it calls the program with no parameters, so you can enter the
  26. ;database name if you keep multiple databases.  If not, you can edit the
  27. ;macro to load a particular database each time.
  28. ;
  29. ;  "<B>oth F,M,A, & Port rep." - This creates a capture file with just the
  30. ;CIM port report, fighters, mines, and avoids.  Read the next two sections
  31. ;for more information.  Note too that this, like all the capturing menu
  32. ;items, checks for old capture files first and erases them if found.
  33. ;
  34. ;  "<P>ort report" - This accesses the CIM (Computer Interrogation Mode) of
  35. ;your Cray XXV (ship computer) and captures the newest port information.
  36. ;
  37. ;  "<F>ighters, mines, avoids" - This produces a capture file of the three
  38. ;things listed.  Great for updating your database for online calculations
  39. ;after deploying a lot of new fighters or mines (or after those fighters or
  40. ;mines have been destroyed).
  41. ;
  42. ;  "<C>omplete capture file" - This captures everything if you want to
  43. ;create a new database, or update all your database information.  This is
  44. ;the only menu item that will capture your CIM sector information and your
  45. ;game status.  Since I explore my universe completely and very quickly (in
  46. ;two days), I never need to update my sector info.  And I rarely bother
  47. ;updating my game status information, so I put them here.  I'm sorry if you
  48. ;have different needs.  If there's a demand, then I could revise the script
  49. ;for a future version.
  50. ;
  51. ;    Some notes:
  52. ;
  53. ;  - I recommend setting up the macro as a Meta Key (an Alt-Key
  54. ;    combination) for quick and smooth access.  You can put the script file
  55. ;    in any directory, just specify the correct path to the macro in the
  56. ;    Meta Key definition.  The script will automatically save your current
  57. ;    directory, switch to the directory which contains your Trade Wars
  58. ;    Assistant files, and switch back to the original directory when
  59. ;    finished.
  60. ;  - I designed the macro to use the same WAITFOR and TRANSMIT commands to
  61. ;    reduce size, giving the macro a kind of "spaghetti" look.  It runs
  62. ;    very smoothly, however.
  63. ;
  64. ;  - When checking for the hotkey presses, it looks for the escape key for
  65. ;    quick exiting in case you access the macro accidentally (enter the
  66. ;    wrong Alt-Key combination).  When this is done, it skips the checking
  67. ;    for old capture file to maintain capture file integrity.
  68. ;
  69. ;  - When you select a menu item, it displays the the macro name in bold
  70. ;    letters on the screen and pauses for 750 milliseconds (3/4ths of a
  71. ;    second), then continues with the macro.
  72. ;
  73. ;  - Make sure you run the macro from the main Trade Wars command line, and
  74. ;    not from the Computer command line, for proper operation.
  75. ;
  76. ;
  77. ;  The script is easily customizable as well.  Especially with the Aspect
  78. ;Script Language reference.  You can change colors, move menu items around,
  79. ;change the item titles and hotkeys, and edit the directory information,
  80. ;the pause time, or capture file name.  I'll indicate sections where you
  81. ;might want to customize.  Any necessary or important customization sections
  82. ;will be indicated by "***" followed by all capitals.
  83. ;
  84. ;  *** NOTE! ***  There is one area you MUST change for proper operation!
  85. ;This is the directory which contains your TW Assistant executable and
  86. ;data files.  They should BOTH be in the same directory.  I put the macro
  87. ;in a separate directory, but you can keep everything in one directory if
  88. ;you like.
  89. ;
  90. ;
  91. ;  Here's the macro:
  92.  
  93.  
  94. PROC MAIN
  95.   CLEAR
  96.  MENU:
  97.   BOX 1 22 9 55 49                  ; Edit colors and box size here
  98.   ATSAY 2 27 48 "<A>ssistant"                  ;
  99.   ATSAY 3 27 48 "<B>oth F,M,A, & Port rep."    ;  Edit the titles or
  100.   ATSAY 4 27 48 "<P>ort report"                ; hotkeys here
  101.   ATSAY 5 27 48 "<F>ighters, mines, avoids"    ;  (Read further if you
  102.   ATSAY 6 27 48 "<C>omplete capture file"      ; edit the hotkeys)
  103.   ATSAY 8 25 49 "Enter macro choice : "
  104.   LOCATE 8,46
  105.   KEYGET N1
  106.   IF N1 == 27    ; Looks for the escape key
  107.     GOTO END
  108.   ENDIF
  109.   KEY2ASCII N1 S1
  110.   STRUPR S1
  111.   CLEAR
  112.   ;                       *** YOU MUST CHANGE THIS NEXT LINE!! ***
  113.   ASSIGN S2 "C:\PCPLUS\TW"  ; This is the path to your TW Assist files
  114.   GETDIR 0 S3  ; Stores current directory
  115.   CHDIR S2     ; Switches to the TW Assist directory
  116.   ;
  117.   SWITCH S1
  118.     CASE "A"  ; *** IF YOU CHANGE the hotkeys, do it here as well!!
  119.       RUN "TWASSIST" ; Command that starts TW Assistant. If you want to
  120.       GOTO END       ; auto load a database put "TWASSIST filename"
  121.     CASE "B"  ; *** HOTKEY location
  122.       FATSAY 3 20 31 " B O T H   F, M, A,  &   P O R T   R E P T. "
  123.       MSPAUSE 750    ; Here is the pause time.  Change it if you like
  124.       CLEAR
  125.       CALL OPENFILE
  126.       ASSIGN S1 "P"
  127.       GOTO FTR
  128.     ENDCASE
  129.     CASE "C"  ; *** HOTKEY location
  130.       FATSAY 3 20 31 " C O M P L E T E   C A P T U R E   F I L E "
  131.       MSPAUSE 750
  132.       CLEAR
  133.       CALL OPENFILE
  134.       GOTO CAP
  135.     ENDCASE
  136.     CASE "F"  ; *** HOTKEY location
  137.       FATSAY 3 20 31 " F I G H T E R S,  M I N E S,  A V O I D S "
  138.       MSPAUSE 750
  139.       CLEAR
  140.       CALL OPENFILE
  141.       GOTO FTR
  142.     ENDCASE
  143.     CASE "P"  ; *** HOTKEY location
  144.       FATSAY 3 22 31 " G E T T I N G   P O R T   R E P O R T "
  145.       MSPAUSE 750
  146.       CLEAR
  147.       CALL OPENFILE
  148.       TRANSMIT "C"
  149.       WAITFOR  "Help) ?" FOREVER
  150.       GOTO PRT
  151.     ENDCASE
  152.     DEFAULT
  153.       GOTO MENU
  154.     ENDCASE
  155.   ENDSWITCH
  156.   ;
  157.  CAP:
  158.   TRANSMIT "V"
  159.   WAITFOR  "Help)? " FOREVER
  160.  FTR:
  161.   TRANSMIT "G"
  162.   WAITFOR  "Help)? " FOREVER
  163.   TRANSMIT "K"
  164.   WAITFOR  "Help)? " FOREVER
  165.   TRANSMIT "C"
  166.   WAITFOR  "Help) ?" FOREVER
  167.   TRANSMIT "X"
  168.   WAITFOR  "Help) ?" FOREVER
  169.   STRCMP S1 "F"
  170.   IF SUCCESS
  171.     GOTO Q2
  172.   ENDIF
  173.  PRT:
  174.   TRANSMIT "╚╔╩╦╠═"
  175.   WAITFOR  ": "      FOREVER
  176.   TRANSMIT "R"
  177.   WAITFOR  ": "      FOREVER
  178.   STRCMP S1 "P"
  179.   IF SUCCESS
  180.     GOTO Q1
  181.   ENDIF
  182.   TRANSMIT "I"
  183.   WAITFOR  ": "      FOREVER
  184.  Q1:
  185.   TRANSMIT "Q"
  186.   WAITFOR  "Help) ?" FOREVER
  187.  Q2:
  188.   TRANSMIT "Q"
  189.   ;
  190.   LOG CLOSE
  191.  END:
  192.   CLEAR
  193.   CHDIR S3       ; Here it switches back to the original directory
  194.   EXIT
  195. ENDPROC
  196.  
  197. PROC OPENFILE
  198.   FINDFIRST "CAPTURE.TXT"   ;
  199.   IF FOUND                  ;
  200.     DELETE "CAPTURE.TXT"    ; *** CHANGE name of capture file here!
  201.   ENDIF                     ;
  202.   LOG OPEN "CAPTURE.TXT"    ;
  203. ENDPROC
  204.  
  205.  
  206. ;  Now I'd like to thank the Martins for such a great game, and of course
  207. ;Albin Gersich for such an excellent database program, and for all his
  208. ;help, listening, and generosity.  Without his utility day-to-day trading
  209. ;would be much less enjoyable.
  210. ;  And a thank you to Casey Stemp, the author of the original Procomm Plus
  211. ;script, for supplying the original from which this script was written, and
  212. ;for his initial praise of my efforts.
  213. ;  And another thank you goes to Dan Roseen, sysop of The Night Owl BBS in
  214. ;Kent, Washington.  He's the one that first told me about Trade Wars
  215. ;Assistant and recommended it so enthusiastically.  The Night Owl is an
  216. ;excellent source of Trade Wars utilities, as well as a planned beta site
  217. ;for TW2002 v2.0.  The number is (206)631-4949.
  218.  
  219.